<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@include file="../../base.jsp" %>



<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>    
<link rel="stylesheet" type="text/css" href="${path}/js/jquery/easyui1.5/themes/bootstrap/easyui.css">
<link rel="stylesheet" type="text/css" href="${path}/js/jquery/easyui1.5/themes/icon.css">
<script type="text/javascript" src="${path}/js/jquery-1.8.0.min.js"></script>
<script src="${path}/js/jquery/easyui1.5/jquery.easyui.min.js"></script>
<script src="${path}/js/jquery/easyui1.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${path}/js/jquery.select.js"></script>

</head>
<body class="font14">
<link rel="stylesheet" type="text/css" href="${path}/admin123/css/footer.css">

<script type="text/javascript">

	//dialog buttons
	var jsonParam_buttons=[{
		text:'提交',
		iconCls:'icon-save',
		handler:function(){
			resetPsd();
		}
	},{
		text:'关闭',
		iconCls:'icon-cancel',
		handler:function(){
			window.parent.closeDialog();
		}
	}];

	var row;
	var id;
	var loginname;
	$(function(){

		//add buttons to dialog
		window.parent.addButtons2IframeDialog(jsonParam_buttons);

		row = '${paramValues.row[0]}';
		row = decodeURI(row);
		row = JSON.parse(row);
		loginname = row.loginname;
		id = row.id;
		$("#my_loginName").val(loginname);

		//保存数据
		$("#my_resetpsd").click(function(){
			resetPsd();
		});
	});

	function resetPsd(){
		var password = $("#password").val();
		var password1 = $("#password1").val();
		if(password != password1){
			$("#password").val("");
			$("#password1").val("");
			alert('密码不一样，请确认');
			return;
		}

		$.ajax({
			type:"POST",
			url:'${path}/admin123/template/user/templateEmpAjax_resetPassword.action',
			dataType:"json",
			data:{'password':password,'username':loginname,'empId':id},
			success:function(msg){
				window.parent.messager_show(msg,2000);
				window.parent.datagrid_fresh();
				window.parent.closeDialog();
			},
			error:function(er){
				window.parent.error(er);
			}
		});
	}
</script>


<div style="margin: 10px;">
	<p>
		用户名称：<input type="text" id="my_loginName" readonly="readonly"/>
	</p>
	<p>登录密码：<input id="password" type="text" name="password"/></p>
	<p>确认密码：<input id="password1" type="text" name="password1"/></p>
</div>


</body>
</html>